import request from '@/utils/request'

/**
 * 蓝海行动列表获取
 * @param {Number} id 代理商id
 */
export function tableInit(id) {
  return request({
    url: '/blueList',
    method: 'GET',
    params: { id }
  })
}

/**
 * 蓝海行动列表分页
 * @param {Number} id 代理商id
 * @param {Number} page 页码
 */
export function tablePage(id, date, page) {
  return request({
    url: '/blueList',
    method: 'GET',
    params: { id, page, serial_num: date.serial_num, store: date.store, agent_name: date.agent_name, status: date.status }
  })
}

/**
 * 蓝海行动列表查询
 * @param {Number} id 代理商id
 * @param {Object} date 搜索参数
 */
export function tableSearch(id, date) {
  return request({
    url: '/blueList',
    method: 'GET',
    params: { id, serial_num: date.serial_num, store: date.store, agent_name: date.agent_name, status: date.status }
  })
}

/**
 * 蓝海行动审核状态获取
 * @param {Number} merchant_id 商户id
 */
export function verifyQueryStatus(merchant_id) {
  return request({
    url: '/verifyQueryStatus',
    method: 'GET',
    params: { merchant_id }
  })
}

/**
 * 蓝海行动审核状态初试话
 * @param {Number} merchant_id 商户id
 */
export function verifyQuery(merchant_id) {
  return request({
    url: '/verifyQuery',
    method: 'GET',
    params: { merchant_id }
  })
}

/**
 * 蓝海行动报名
 * @param {Number} merchant_id 商户id
 * @param {Array} array 图片集合
 */
export function blueJionInit(merchant_id, array) {
  const data = { merchant_id, array }
  return request({
    url: '/lanHaiEnlist',
    method: 'POST',
    data
  })
}

/**
 * 蓝海行动报名确认
 * @param {Number} merchant_id 商户id
 */
export function blueJion(merchant_id) {
  return request({
    url: '/lanHaiEnlistConfirm',
    method: 'GET',
    params: { merchant_id }
  })
}

/**
 * 活动状态更改
 * @param {Number} merchant_id 商户id
 * @param {Number} status status
 * @param {Number} apply_status apply_status 100：申请中;110：入驻中;120：入驻成功;200：报名中;300：报名成功;400：已成功;500：未通过 000-已入驻
 */
export function BlueStatus(merchant_id, status, apply_status) {
  return request({
    url: '/lanhaiStatus',
    method: 'GET',
    params: { merchant_id, status, apply_status }
  })
}

/**
 * 活动审核状态更新
 * @param {Number} merchant_id 商户id
 * @param {Number} channel_status status
 */
export function BlueStatusChannel(merchant_id, channel_status) {
  return request({
    url: '/verifyBlue',
    method: 'GET',
    params: { merchant_id, channel_status }
  })
}
